(ns com.yawmark.euler.clj.e4)

;; A palindromic number reads the same both ways. The largest palindrome
;; made from the product of two 2-digit numbers is 9009 = 91 X 99.
;; Find the largest palindrome made from the product of two 3-digit numbers.

(defn- is-palindrome [n]
      (= (str n) (apply str (reverse (str n)))))

(def products
     (for [x (range 100 1000)
           y (range 100 x)]
          (* x y)))

(defn euler-4 []
      (apply max (filter is-palindrome products)))     

(println (time (euler-4)))
